# -*- coding: utf-8 -*-
"""
Created on Tue Jun 26 10:55:13 2012

@author: nzhao
"""
from phy.general.Constant import SpinDictionary
from phy.spin.SingleSpin import SingleSpin

elements = {'C': 'C13'}

def readfile(filename):
    fi = open(filename, 'r')
    
    spin_list = []
    for line in fi:
        items = line.split()
        print items
        if items[0] in SpinDictionary.keys():
            spin = SingleSpin(element=items[0], x = float(items[1]), y = float(items[2]), z = float(items[3]), spin_type = items[4],spin_mark = items[5])
            spin_list.append( spin )
    fi.close()
    return spin_list